<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>父子组件-动态传递数据</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.js"></script>
</head>
<body>
<div id="case13-demo5">
    <my-div></my-div>
</div>
<script type="text/javascript">
    var case13Demo5=new Vue({
        el:"#case13-demo5",
        data:{

        },
        components:{
            'my-div':{
                data() {
                    return{
                        parentmsg:"今天天气很好"
                    }
                },
                template:`
                        <div>
                            <input type="text" v-model="parentmsg">
                            <my-div-son v-bind:msg="parentmsg"></my-div-son>
                        </div>
                `,
                components: {
                    'my-div-son':{
                        props:['msg'],
                        template: `<div>{{msg}}</div>`
                    }
                }

            }
        }
    })
</script>
</body>
</html>